/*
 * @Description:Student
 * 
 * @Author: rendc
 * 
 * @Date: 2025-07-29 16:07:02
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-07-30 11:13:46
 */

public class Student {
  // 属性
  private int id; // 主键 非空 唯一 mysql
  private String name;
  private String gender;
  private int age;

  // 构造器
  // 无参构造器 代码块与构造器的执行顺序
  public Student() {
    System.out.println("无参构造器");
  }

  // 全参构造器
  public Student(int id, String name, String gender, int age) {
    // System.out.println("全参构造器");
    this.id = id;
    this.name = name;
    this.gender = gender;
    this.age = age;
  }

  // get、set
  public int getId() {
    return id;
  }

  public String getName() {
    return name;
  }

  public String getGender() {
    return gender;
  }

  public int getAge() {
    return age;
  }

  public void setId(int id) {
    this.id = id;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setGender(String gender) {
    this.gender = gender;
  }

  public void setAge(int age) {
    this.age = age;
  }

  // show
  public void show() {
    System.out.print("【学生】id:" + id);
    System.out.print("，name:" + name);
    System.out.print("，gender:" + gender);
    System.out.println("，age:" + age);
  }
}